package com.laikan.reader.bookfriend.fragment.impl;

import com.laikan.reader.R;
import com.laikan.reader.bookfriend.adapter.BaseListAdapter;
import com.laikan.reader.bookfriend.adapter.impl.BookAdapter;
import com.laikan.reader.bookfriend.entity.PageAutherBean;
import com.laikan.reader.bookfriend.fragment.AutherFragment;
import com.laikan.reader.bookfriend.requester.AutherRequester;
import com.socks.library.KLog;


/**
 * Created by lingyt on 2016/11/16.
 * 作品页
 */
public class BookFragment extends AutherFragment {

    @Override
    protected BaseListAdapter getAdapter() {
        return new BookAdapter(getActivity(),R.layout.view_item_template_img_left);
    }

    @Override
    protected void loadData(int pageNo) {
        KLog.w(args,"load Data:开始加载第 "+pageNo+" 页数据");
        String authorId = getAuthorId();
        int shortePageNo = 1;
        AutherRequester.requestAutherHomeData(authorId,pageNo,pageNo,mCallback);
    }

    @Override
    public void refreshFragmentData() {
        PageAutherBean bean = (PageAutherBean) getFragmentData();
        mState = checkData(bean.data.bookList);
        showData(bean.data.bookList);
    }

}
